home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 1 / Gold Medal Software Volume 1 (Gold Medal) (1994).iso / prog / tpwprog6.arj / USTR2.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-07-02  |  863 b   |  40 lines

  1. { UStr2.pas -- StrMain subunit #2 }
  2.  
  3. unit UStr2;
  4.  
  5. interface
  6.  
  7. {$R ustr2.res}
  8.  
  9. uses WinTypes;
  10.  
  11. procedure ShowMessage(HWindow: HWnd; MsgNum: Word);
  12.  
  13. implementation
  14.  
  15. uses WinProcs;
  16.  
  17. const
  18.  
  19.   msgNumOffset = 100;    { First string-table ID }
  20.   maxLen = 65;           { Maximum allowed string size }
  21.  
  22. {- Display message from string table }
  23. procedure ShowMessage(HWindow: HWnd; MsgNum: Word);
  24. var
  25.   Buffer: array[0 .. maxLen] of Char;
  26.   N: Word;
  27. begin
  28.   N := LoadString(HInstance, msgNumOffset + MsgNum, Buffer, maxLen);
  29.   if N > 0 then
  30.     MessageBox(HWindow, Buffer, 'String Table Message', mb_Ok)
  31. end;
  32.  
  33. end.
  34.  
  35.  
  36. {--------------------------------------------------------------
  37.   Copyright (c) 1991 by Tom Swan. All rights reserved.
  38.   Revision 1.00    Date: 4/16/1991
  39. ---------------------------------------------------------------}
  40.